/*
 * ImageLoader.h
 * Utility class which loads/writes windows BMP files
 *
 * @version 	1.00 Feb 2011
 * @author 		Eric Stock
 */

#ifndef __ImageLoaderH
#define __ImageLoaderH

#include "image.h"
#include "Utility.h"
#include "windows.h"

#pragma pack(2)
struct FileHeader  
{
    char bmtype[2];					// must be 'BM' 
    unsigned int iFileSize;			// size of the whole .bmp file
    short int reserved1;			// must be 0
    short int reserved2;			// must be 0
    unsigned int iOffsetBits;
};
#pragma pack()

#pragma pack(2)
struct BitmapInfoHeader    
{
    unsigned int iSizeHeader;		// size of the structure
    unsigned int iWidth;			// image width
    unsigned int iHeight;			// image height
    short int iPlanes;				// bitplanes
    short int iBitCount;			// resolution 
    unsigned int Compression;		// compression
    unsigned int iSizeImage;		// size of the image
    unsigned int iXPelsPerMeter;	// pixels per meter X
    unsigned int iYPelsPerMeter;	// pixels per meter Y
    unsigned int iClrUsed;			// colors used
    unsigned int iClrImportant;		// important colors
};
#pragma pack()

class ImageLoader
{
    public:
		ImageLoader::ImageLoader() {}; 
        void ImageLoader::ReadFile(const char* fileName, Image* theTexture);
        void ImageLoader::WriteFile(const char* fileName, unsigned int width, unsigned int height, Pics* image);
        
    private:
};   

#endif 
